home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: What is &Variable (declared as: char Var
- Date: Wed, 28 Feb 96 13:28:11 GMT
- Organization: none
- Message-ID: <825514091snz@genesis.demon.co.uk>
- References: <13b_9602272020@amphigory.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <13b_9602272020@amphigory.com> Pazuzu@amphigory.com "Pazuzu" writes:
-
- >myarray may not be a pointer (actually, it IS, but for the sake of argument...)
- >but EVERYTHING, EVERYTHING, EVERYTHING has a memory address (otheriwise, it
- >ain't in memory!), and &<identifier> gives you its address. myarray IS a
- >pointer. All arrays are pointers.
-
- False - arrays and pointers are two entirely different things. To qualify
- what you say all objects and functions have a memory address and an array
- is an object. An array happens to be a compound object made up of a contiguous
- group of smaller (well you can have a 1 element array) objects i.e. its
- elements. Like all other objects an array has an address and each of its
- elements has an address. There just happens to be a shorthand syntax
- to take the address of an array's elements e.g. &myarray[0] can be written
- simply as myarray. That's not saying that myarray is a pointer any more than
- i is a pointer in int i; however both have addresses and therefore pointer
- (rvalues) to each can be generated.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-